<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: BaseWorldUtility Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00030.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">BaseWorldUtility Class Reference<div class="ingroups"><a class="el" href="a00516.html">baseModules - base module classes of MiXiM</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="BaseWorldUtility" -->
<p>Provides information and utility methods for the whole simulation.  
 <a href="a00030.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00276_source.html">BaseWorldUtility.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for BaseWorldUtility:</div>
<div class="dyncontent">
<div class="center"><img src="a00602.png" border="0" usemap="#BaseWorldUtility_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for BaseWorldUtility:</div>
<div class="dyncontent">
<div class="center"><img src="a00603.png" border="0" usemap="#BaseWorldUtility_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00604.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a08cd184861fa214245ba5c9928e5aefc"></a><!-- doxytag: member="BaseWorldUtility::initialize" ref="a08cd184861fa214245ba5c9928e5aefc" args="(int stage)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>initialize</b> (int stage)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00065.html">Coord</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a179c8bf9d4613cbb1af0a85d779827a6">getPgs</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the playgroundSize.  <a href="#a179c8bf9d4613cbb1af0a85d779827a6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a37a1abb90a220afdaf6dbdab58299e51"></a><!-- doxytag: member="BaseWorldUtility::useTorus" ref="a37a1abb90a220afdaf6dbdab58299e51" args="()" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a37a1abb90a220afdaf6dbdab58299e51">useTorus</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if our playground represents a torus (borders are connected) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3c574ecd7a055ba2407f638ce548bc24"></a><!-- doxytag: member="BaseWorldUtility::getRandomPosition" ref="a3c574ecd7a055ba2407f638ce548bc24" args="()" -->
virtual <a class="el" href="a00065.html">Coord</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a3c574ecd7a055ba2407f638ce548bc24">getRandomPosition</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Random position somewhere in the playground. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a84c3d488e01d52be51c686e3fb206498"></a><!-- doxytag: member="BaseWorldUtility::use2D" ref="a84c3d488e01d52be51c686e3fb206498" args="()" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a84c3d488e01d52be51c686e3fb206498">use2D</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the world is 2-dimensional. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c955c6c60dfa5b46a2bf683a20a84fe"></a><!-- doxytag: member="BaseWorldUtility::getUniqueAirFrameId" ref="a1c955c6c60dfa5b46a2bf683a20a84fe" args="()" -->
long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a1c955c6c60dfa5b46a2bf683a20a84fe">getUniqueAirFrameId</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an Id for an AirFrame, at the moment simply an incremented long-value. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static const double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a84d040f815027b3098451b02733ac63d">speedOfLight</a> = 299792458.0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Speed of light in meters per second.  <a href="#a84d040f815027b3098451b02733ac63d"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#aabcceb57843568c213b0772b08971827">initializeIfNecessary</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes all members accessible by other modules.  <a href="#aabcceb57843568c213b0772b08971827"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00065.html">Coord</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a74ba640d810a03334770d1f150fe1da4">playgroundSize</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the area the nodes are in (in meters)  <a href="#a74ba640d810a03334770d1f150fe1da4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa906ac76b1c5b51f6743104b532ed4f3"></a><!-- doxytag: member="BaseWorldUtility::useTorusFlag" ref="aa906ac76b1c5b51f6743104b532ed4f3" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#aa906ac76b1c5b51f6743104b532ed4f3">useTorusFlag</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should the playground be treatend as a torus? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abc092a88c21ecc008a7a32bc311201e7"></a><!-- doxytag: member="BaseWorldUtility::use2DFlag" ref="abc092a88c21ecc008a7a32bc311201e7" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#abc092a88c21ecc008a7a32bc311201e7">use2DFlag</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should the world be 2-dimensional? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a490427de9d083bd510a4370002f70716"></a><!-- doxytag: member="BaseWorldUtility::airFrameId" ref="a490427de9d083bd510a4370002f70716" args="" -->
long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a490427de9d083bd510a4370002f70716">airFrameId</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides a unique number for AirFrames per simulation. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3c5b996451b88c37022a191668d715a1"></a><!-- doxytag: member="BaseWorldUtility::isInitialized" ref="a3c5b996451b88c37022a191668d715a1" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00030.html#a3c5b996451b88c37022a191668d715a1">isInitialized</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores if members are already initialized. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Provides information and utility methods for the whole simulation. </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a179c8bf9d4613cbb1af0a85d779827a6"></a><!-- doxytag: member="BaseWorldUtility::getPgs" ref="a179c8bf9d4613cbb1af0a85d779827a6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="a00065.html">Coord</a>* BaseWorldUtility::getPgs </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the playgroundSize. </p>
<p>Note: The playground is in the range [0, playground size]. Meaning the upper borders (at pg-size) as well as the lower borders (at 0) are part of the playground. </p>

<p>Referenced by <a class="el" href="a00173.html#aaecc372ab08295d393581440b326922f">PhyLayer::getAnalogueModelFromName()</a>, and <a class="el" href="a00019.html#a0d39342f1e732ad44ef7e4e2dccac24f">BaseConnectionManager::initialize()</a>.</p>
<div class="fragment"><pre class="fragment">                         {
      <a class="code" href="a00030.html#aabcceb57843568c213b0772b08971827" title="Initializes all members accessible by other modules.">initializeIfNecessary</a>();
        <span class="keywordflow">return</span> &amp;<a class="code" href="a00030.html#a74ba640d810a03334770d1f150fe1da4" title="Size of the area the nodes are in (in meters)">playgroundSize</a>;
    }
</pre></div>
</div>
</div>
<a class="anchor" id="aabcceb57843568c213b0772b08971827"></a><!-- doxytag: member="BaseWorldUtility::initializeIfNecessary" ref="aabcceb57843568c213b0772b08971827" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BaseWorldUtility::initializeIfNecessary </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initializes all members accessible by other modules. </p>
<p>Called once the first time another module accesses a member or during initialize stage 0 at the latest. </p>

<p>References <a class="el" href="a00030.html#a490427de9d083bd510a4370002f70716">airFrameId</a>, <a class="el" href="a00030.html#a3c5b996451b88c37022a191668d715a1">isInitialized</a>, <a class="el" href="a00030.html#a74ba640d810a03334770d1f150fe1da4">playgroundSize</a>, <a class="el" href="a00030.html#abc092a88c21ecc008a7a32bc311201e7">use2DFlag</a>, and <a class="el" href="a00030.html#aa906ac76b1c5b51f6743104b532ed4f3">useTorusFlag</a>.</p>

<p>Referenced by <a class="el" href="a00030.html#a3c574ecd7a055ba2407f638ce548bc24">getRandomPosition()</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="keywordflow">if</span>(<a class="code" href="a00030.html#a3c5b996451b88c37022a191668d715a1" title="Stores if members are already initialized.">isInitialized</a>)
    <span class="keywordflow">return</span>;

  <span class="comment">//use2DFlag      = par(&quot;use2D&quot;);</span>
  <a class="code" href="a00030.html#a74ba640d810a03334770d1f150fe1da4" title="Size of the area the nodes are in (in meters)">playgroundSize</a> = <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>(par(<span class="stringliteral">&quot;playgroundSizeX&quot;</span>).doubleValue(),
                               par(<span class="stringliteral">&quot;playgroundSizeY&quot;</span>).doubleValue(),
                               <a class="code" href="a00030.html#abc092a88c21ecc008a7a32bc311201e7" title="Should the world be 2-dimensional?">use2DFlag</a> ? 0. : par(<span class="stringliteral">&quot;playgroundSizeZ&quot;</span>).doubleValue());

  <span class="keywordflow">if</span>(<a class="code" href="a00030.html#a74ba640d810a03334770d1f150fe1da4" title="Size of the area the nodes are in (in meters)">playgroundSize</a>.x &lt; 0) {
    opp_error(<span class="stringliteral">&quot;Playground size in X direction is invalid: &quot;</span>\
          <span class="stringliteral">&quot;(%f). Should be greater than or equal to zero.&quot;</span>, <a class="code" href="a00030.html#a74ba640d810a03334770d1f150fe1da4" title="Size of the area the nodes are in (in meters)">playgroundSize</a>.x);
  }
  <span class="keywordflow">if</span>(<a class="code" href="a00030.html#a74ba640d810a03334770d1f150fe1da4" title="Size of the area the nodes are in (in meters)">playgroundSize</a>.y &lt; 0) {
    opp_error(<span class="stringliteral">&quot;Playground size in Y direction is invalid: &quot;</span>\
          <span class="stringliteral">&quot;(%f). Should be greater than or equal to zero.&quot;</span>, <a class="code" href="a00030.html#a74ba640d810a03334770d1f150fe1da4" title="Size of the area the nodes are in (in meters)">playgroundSize</a>.y);
  }
  <span class="keywordflow">if</span>(!<a class="code" href="a00030.html#abc092a88c21ecc008a7a32bc311201e7" title="Should the world be 2-dimensional?">use2DFlag</a> &amp;&amp; <a class="code" href="a00030.html#a74ba640d810a03334770d1f150fe1da4" title="Size of the area the nodes are in (in meters)">playgroundSize</a>.z &lt; 0) {
    opp_error(<span class="stringliteral">&quot;Playground size in Z direction is invalid: &quot;</span>\
          <span class="stringliteral">&quot;(%f). Should be greater than or equal to zero.&quot;</span>, <a class="code" href="a00030.html#a74ba640d810a03334770d1f150fe1da4" title="Size of the area the nodes are in (in meters)">playgroundSize</a>.z);
  }

  <a class="code" href="a00030.html#aa906ac76b1c5b51f6743104b532ed4f3" title="Should the playground be treatend as a torus?">useTorusFlag</a> = par(<span class="stringliteral">&quot;useTorus&quot;</span>);

  <a class="code" href="a00030.html#a490427de9d083bd510a4370002f70716" title="Provides a unique number for AirFrames per simulation.">airFrameId</a> = 0;

  <a class="code" href="a00030.html#a3c5b996451b88c37022a191668d715a1" title="Stores if members are already initialized.">isInitialized</a> = <span class="keyword">true</span>;
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a74ba640d810a03334770d1f150fe1da4"></a><!-- doxytag: member="BaseWorldUtility::playgroundSize" ref="a74ba640d810a03334770d1f150fe1da4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00065.html">Coord</a> <a class="el" href="a00030.html#a74ba640d810a03334770d1f150fe1da4">BaseWorldUtility::playgroundSize</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Size of the area the nodes are in (in meters) </p>
<p>Note: The playground is in the range [0, playground size]. Meaning the upper borders (at pg-size) as well as the lower borders (at 0) are part of the playground. </p>

<p>Referenced by <a class="el" href="a00030.html#a3c574ecd7a055ba2407f638ce548bc24">getRandomPosition()</a>, and <a class="el" href="a00030.html#aabcceb57843568c213b0772b08971827">initializeIfNecessary()</a>.</p>

</div>
</div>
<a class="anchor" id="a84d040f815027b3098451b02733ac63d"></a><!-- doxytag: member="BaseWorldUtility::speedOfLight" ref="a84d040f815027b3098451b02733ac63d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const double <a class="el" href="a00030.html#a84d040f815027b3098451b02733ac63d">BaseWorldUtility::speedOfLight</a> = 299792458.0<code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Speed of light in meters per second. </p>
<p>meters per second </p>

<p>Referenced by <a class="el" href="a00052.html#abeb688210449aa6a62cb9cd76e5cfeaa">ConnectionManager::calcInterfDist()</a>, <a class="el" href="a00199.html#ade7562b60b0a5ced0d81ca29bee99ffd">SimplePathlossModel::calcPathloss()</a>, <a class="el" href="a00053.html#a3b29e3e00f660a18c7afa75d129e0049">ConnectionManagerAccess::calculatePropagationDelay()</a>, <a class="el" href="a00199.html#a7a1a3a2080c5cf5d7ac3550f33099508">SimplePathlossModel::filterSignal()</a>, <a class="el" href="a00198.html#aa263547a6e528cc1acf88fc496510e40">SimplePathlossConstMapping::getValue()</a>, and <a class="el" href="a00115.html#a23e8978d7aab4509f846ac6a8044de19">JakesFadingMapping::getValue()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/modules/<a class="el" href="a00276_source.html">BaseWorldUtility.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/modules/BaseWorldUtility.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00030.html">BaseWorldUtility</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
